﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using SAASInvest.Contracts;
using System.IO;

namespace SAASInvest.ConsoleHost
{
    class Program
    {
        static void Main(string[] args)
        { 
            using (ServiceHost host = new ServiceHost(typeof(SAASInvest.ConsoleHost.Controller)))
            {
                host.Open();
                Console.WriteLine("IController service has opened!");
            }

            //try
            //{
            //    ChannelFactory<IController> channelFacotry = (new ChannelFactory<IController>("ConsoleController"));
            //    var client = channelFacotry.CreateChannel();
            //    client.UploadFile(new FileUploadStream() { 
            //        UploadStream=new FileStream("D:\\a.txt", FileMode.OpenOrCreate)
            //    });
            //}
            //catch (Exception e)
            //{
            //    Console.WriteLine(e.Message);
            //}
            Console.ReadKey();
        }
    }
}
